package zzx.ccf_201312;

import java.util.Scanner;

public class ISBNnumber {
	public static void main(String[] args) {
		char[] a; // 记录ISBN
		int[] b = new int[10]; // 记录ISBN中的数字
		int i, j = 0, sum = 0, last;
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append(sc.nextLine());
		a = sb.toString().toCharArray();
		for (i = 0; i < a.length; i++) {
			if (a[i] >= '0' && a[i] <= '9') {
				b[j++] = a[i] - '0';
			}
		}
		for (i = 0, j = 1; i < b.length - 1; i++, j++) {
			sum = sum + b[i] * j;
		}
		last = sum % 11;
		if (last == b[b.length - 1]) {
			System.out.println("Right");
		} else {
			if (last == 10) {
				a[a.length - 1] = 'X';
			} else {
				a[a.length - 1] = (char) (last + '0');
			}
			System.out.println(a);
		}
	}
}
